<%@ page language="java" pageEncoding="UTF-8"%>
<%@include file="/views/common/include/taglib.jsp"%>
<script
    src="${ctx}/js/controllers/base/commonconfig/ConfigListForPropertyController.js"
    type="text/javascript"></script>
<section>
    <div style="height: 40px; line-height: 40px;">
        <div class="forword_area"></div>
        <div class="location">当前位置：${sessionScope.currcent_position}</div>
    </div>
    <hr>
    <section class="panel panel-default">
        <!--begin table表格 -->
        <div>
            <div>
                <div>
                    <input id="label" type="text" maxlength="20"
                        value="${(not empty label)? label : ''  }"
                        class="input-sm form-control" placeholder="描述">&nbsp;
                     <%-- <div class="btn-group">
                       <select class="dropdown-menu" id="cellId">
                            <option value=""
                                <c:if test="${cellId == null }">selected="selected"</c:if>>小区名</option>
                            <c:forEach items="${cellInfos}" var="item" varStatus="cStatus">
                                <option value="${item.id}"
                                    <c:if test="${item.id == cellId}">selected="selected"</c:if>>${item.cellName}</option>
                            </c:forEach>
                        </select> 
                    </div>--%>
                    <div class="btn-group">
						<select class="dropdown-menu" id="pSize">
							<c:forEach items="${pageSizes }" var="item">
								<option value="${item.value }"
									<c:if test="${pSize == item.value }">selected</c:if>>&nbsp;&nbsp;&nbsp;${item.label }</option>
							</c:forEach>
						</select>
					</div>
                    <div class="form-control">
                        <div class="search" onclick="getInfoList();">
                            <img src="${ctx }/images/table/search_second.png">
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!--end 搜索栏 -->
        <div>
            <table class="table">
                <thead>
                    <tr>
                        <th width="5%">序号</th>
                        <c:if test="${configureType != 1}">
                        <th width="15%">小区</th>
                        </c:if>
                        <th width="20%">描述</th>
                        <th width="15%">名称</th>
                        <th width="15%">值</th>
                        <!-- <th width="5%">单位</th> -->
                        <th width="25%">操作</th>
                    </tr>
                </thead>
                <tbody id="tableTbody">
                    <c:forEach items="${infoList.list}" var="config"
                        varStatus="configStatus">
                        <tr onmouseover="mouseoverOne(this)"
                            onmouseout="mouseoutOne(this)">
                            <td>${configStatus.index + 1 }</td>
                            <c:if test="${config.cellName != null}">
                            <td>${config.cellName}</td>
                            </c:if>
                            <td>${config.label}</td>
                            <td>${config.name}</td>
                            <td>
                                <c:choose>
                                <c:when test="${fn:length(config.value) < 20}">${config.value}</c:when>
                                <c:otherwise>——</c:otherwise> 
                                </c:choose>
                            </td>
                            <%-- <td>${config.unit}</td> --%>
                            <td>
                            <c:if test="${config.name == 'property_min_month'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',2);">编辑&nbsp;|</a>
                                </c:if> 
                                <c:if test="${config.name == 'property_feebill_paytime'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',2);">编辑&nbsp;|</a>
                                </c:if>
                                 <c:if test="${config.name == 'property_feebill_memo'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',1);">编辑&nbsp;|</a>
                                </c:if> 
                                <c:if test="${config.name == 'property_billtype_memo'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',1);">编辑&nbsp;|</a>
                                </c:if> 
                                <%-- <c:if test="${config.name == 'mall_integral_config'}">
                                    &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<a class="fa fa-check " onclick="editConfig('${config.id}');" style="text-align:right;">编辑积分配置&nbsp;|</a>
                                </c:if> --%>
                                <c:if test="${config.name == 'car_feebill_memo'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',1);">编辑&nbsp;|</a>
                                </c:if>
                                <c:if test="${config.name == 'car_billtype_memo'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',1);">编辑&nbsp;|</a>
                                </c:if>
                                <c:if test="${config.name == 'car_if_pay'}">
                                    <a class="fa fa-check " onclick="editConfig('${config.id}',1);">编辑&nbsp;|</a>
                                </c:if>
                                <a class="fa fa-check " onclick="detailConfig('${config.id}');">详情</a>
                            </td>
                        </tr>
                    </c:forEach>
                </tbody>
                <tfoot>
                    <tr>
                        <td colspan="7">
                            <div>
                                <input id="pages" type="hidden" value="${infoList.pages}">
                                <div style="float: left;">
                                    <span class="total">合计 ${infoList.total} 条数据</span>
                                </div>
                                <div style="float: right; margin-right: 10px; margin-top: 29px">
                                    <div style="float: left;">
                                        <ul class="footer_ul">
                                            <c:if test="${infoList.hasPreviousPage }">
                                                <li onclick="gotoPage(${currentPage-1 });"><a
                                                    style="color: #37CED4">&lt;&lt;</a></li>
                                            </c:if>
                                            <c:if test="${infoList.firstPage > 1}">
                                                <li onclick="gotoPage(1);"
                                                    style="border: 1px solid #9A9A9A;"><a>1</a></li>
                                                <c:if test="${detailInfo.firstPage > 2}">
                                                    ...
                                                </c:if>
                                            </c:if>
                                            <c:forEach items="${infoList.navigatepageNums }" var="page">
                                                <li onclick="gotoPage(${page });"
                                                    class="<c:if test="${currentPage == page }">active</c:if>"
                                                    style="border: 1px solid #9A9A9A;"><a>${page}</a></li>
                                            </c:forEach>
                                            <c:if test="${infoList.lastPage < infoList.pages}">
                                                <c:if test="${infoList.firstPage < infoList.pages - 1}">
                                                    ...
                                                </c:if>
                                                <li onclick="gotoPage(${infoList.pages});"
                                                    style="border: 1px solid #9A9A9A;"><a>${detailInfo.pages}</a>
                                                </li>
                                            </c:if>
                                            <c:if test="${infoList.hasNextPage }">
                                                <li><a onclick="gotoPage(${currentPage+1});"
                                                    style="color: #37CED4">&gt;&gt;</a></li>
                                            </c:if>
                                        </ul>
                                    </div>
                                    <div style="float: left; height: 30px;">
                                        <span>跳转到</span> <input class="inputclass" id="pageNo"
                                            onkeydown="if(event.keyCode==13){event.keyCode=0;return false;}"
                                            type="text" value="${currentPage }"
                                            style="width: 30px; height: 31px" onkeyup = "checInputNum(this)"> <span>页</span> <span
                                            class="buttonclass" id="J_JumpTo"
                                            onclick="gotoConfigPage(null);"><a>GO</a></span>
                                    </div>
                                </div>
                            </div>
                        </td>
                    </tr>
                </tfoot>
            </table>

        </div>
        <%@include file="/views/common/footer.jsp"%>
    </section>
</section>
<script type="text/javascript">
        var ctx = '${ctx}';
        setCtx(ctx);
        
        //实现选中取消切换图片
        $("tbody td>img").toggle(function(){    
            $(this).attr("src","${ctx }/images/tables/honggou.png"); 
            //$(this).parents("tr").children().each(function(){
               // $(this).css("background","#D3F0F1");
           //});    
        },function(){    
            $(this).attr("src", "${ctx }/images/tables/wugou.png"); 
            //$(this).parents("tr").children().each(function(){
                //$(this).css("background","");
           //});
            });
            
        //实现全选切换所有选项图标
        $("#all").toggle(function(){    
            $(this).attr("src","${ctx }/images/tables/honggou.png"); 
            $("tbody td>img").attr("src","${ctx }/images/tables/honggou.png");  
        },function(){    
            $(this).attr("src", "${ctx }/images/tables/wugou.png"); 
            $("tbody td>img").attr("src","${ctx }/images/tables/wugou.png");  
            });
    </script>
<!-- 解决ie 6 7 8 9不能显示placeholder的问题 -->
<script src="${ctx}/js/lib/jquery.JPlaceholder.js"></script>
